<template>
  <div>
    <headerComponent title="我的收藏"></headerComponent>
    <!-- 没有数据显示 -->
    <van-empty
      class="custom-image"
      image="https://img.yzcdn.cn/vant/custom-empty-image.png"
      description="还有没有收藏哦"
      v-if="list.length == 0"
    />
    <categoryitem
      :category="item"
      v-for="(item, index) in list"
      :key="index"
      v-else
    ></categoryitem>
  </div>
</template>

<script>
import headerComponent from "@/components/HeaderCompon";
import categoryitem from "@/components/categoryitem";
export default {
  components: {
    headerComponent,
    categoryitem
  },
  data() {
    return {
      list: []
    };
  },
  mounted() {
    this.$axios({
      url: "/user_star"
    }).then(res => {
      this.list = res.data.data;
      console.log(res);
    });
  }
};
</script>

<style>
</style>